package org.wannatrak.android.maps;

import java.util.ArrayList;
import java.util.List;

import android.graphics.drawable.Drawable;

import com.google.android.maps.MapView;
import com.google.android.maps.OverlayItem;

public class PointsOverlay
    extends BalloonItemizedOverlay<OverlayItem>
{
    private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();

    
    public PointsOverlay(Drawable defaultMarker, MapView mapView)
    {
        super(boundCenter(defaultMarker), mapView);
    }
    
    public void addOverlay(OverlayItem overlay)
    {
        mOverlays.add(overlay);
        populate();
    }

    public void addOverlays(List<OverlayItem> theOverlays)
    {
        mOverlays.addAll(theOverlays);
        populate();
    }
    
    protected OverlayItem createItem(int i)
    {
        return mOverlays.get(i);
    }

    public int size()
    {
        return mOverlays.size();
    }
    
    
    public ArrayList<OverlayItem> getmOverlays()
    {
        return mOverlays;
    }

}